package com.smrs.goods.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.jof.framework.dao.hibernate.BaseDAOHibernateImpl;
import com.smrs.goods.dao.GoodsSkuAttributeDao;
import com.smrs.goods.model.GoodsSkuAttributeModel;
import com.smrs.service.BaseService;

@Component(value="goodsSkuAttributeService")
public class GoodsSkuAttributeService extends BaseService<GoodsSkuAttributeModel,Long>{
	
	@Autowired
	private GoodsSkuAttributeDao goodsSkuAttributeDao ;
	

	
	/*
	public Pager<RegionModel> getByNameLikePager(final RegionSearchModel model){
		String name = model.getRegion().getName();
		Pager<RegionModel> pager = goodsItemDao.getByNameLikePager(name,model.getPager()); 
		return pager;
		//return null;
	}
	
	public Pager<GoodsSkuModel> getByNameLikePager(String name, Pager<GoodsSkuModel> pager){
		//String name = model.getRegion().getName();
		Pager<GoodsSkuModel> tempPager = getPerformDao().getByNameLikePager(name,pager); 
		return tempPager;
		//return null;
	}
	*/
	
	public BaseDAOHibernateImpl<GoodsSkuAttributeModel, Long> getPerformDao() {		
		return goodsSkuAttributeDao;
	}

	public List<GoodsSkuAttributeModel> getSkuAttributeBySkuId(Long skuId){
		List<GoodsSkuAttributeModel> list=goodsSkuAttributeDao.getSkuAttributeBySkuId(skuId);
		return list;
	}

	public List<GoodsSkuAttributeModel> getSkuAttributeByItemId(Long itemId){
		List<GoodsSkuAttributeModel> list=goodsSkuAttributeDao.getSkuAttributeByItemId(itemId);
		return list;
	}
	
	public List<GoodsSkuAttributeModel> findByItemIdAndAttrValueId(Long itemId,Long attrValueId){
		List<GoodsSkuAttributeModel> list=goodsSkuAttributeDao.getSkuAttributeByItemId(itemId);
		return list;
	}
	
}
